﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp3
{
    class SumUtils
    {//计算两个整数相加、
        //两个小数相加、 
        //两个字符串相加、
        //以及从 1 到指定整数的和的方法。

        public int Sum(int a, int b)
        {
            int c;
            return c = a + b;
            Console.WriteLine(c);
        }
        public double Sum(double aa, double bb)
        {
            int cc;
            return aa + bb;
            Console.WriteLine(cc);

        }
        public string Sum(string a, string b)
        {
            int c;
            return a + b;
            Console.WriteLine(c);
        }
        public void Sum(int c)
        {
            int sum = 0;
            for (int i = 0; i < c; i++)
            {
                sum += c;
            }
            Console.WriteLine("从 1 到指定整数的和为:" + sum);
        }
    }
}
